<?
include("common/header.html");
include("common/left.html");
include("common/page.php");
//-------------------------------------------------------
$method = 2;
include("common/billcommon_r.php");
//-------------------------------------------------------
$r=array();
$status=array();
$where="where fid=$memberID and orders<>0";
$sDate = $_REQUEST['btime'] ? $_REQUEST['btime']:date('Y-1-1');
$eDate = $_REQUEST['etime'] ? $_REQUEST['etime']:date('Y-m-d');
$where.=" and etime>='".$sDate." 00:00:00'";
$where.=" and etime<='".$eDate." 23:59:59'";
if(isset($_REQUEST['status'])){
    $status=$_REQUEST['status'];
    $where.=" and status in (".implode(",",$status).")";
}

$pageSize = $_REQUEST['pageSize'] ? $_REQUEST['pageSize']:15;
$currentPage = $_REQUEST['currentPage'] ? $_REQUEST['currentPage']:1;
$start = ($currentPage-1) * $pageSize;
$limit = " limit $start,$pageSize";
$str="select * from uu_bill $where $limit";
$GLOBALS['le']->query($str);
while($row=$GLOBALS['le']->fetch_assoc()){
    $r[]=$row;
}
$str="select count(*) as num from uu_bill $where";
$GLOBALS['le']->query($str);
$GLOBALS['le']->fetch_assoc();
$count=$GLOBALS['le']->f("num");

$h3Title="应付款账单";
$about="pay";
include("tpl/bill.tpl");
include("common/footer.html");?>